
package com.lyun.controller;

import com.lyun.common.R;
import com.lyun.dto.AdminMovementsDTO;
import com.lyun.service.MovementsService;
import com.lyun.vo.AdminMovementsVO;
import com.lyun.vo.PageVO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/movement")
@CrossOrigin
public class AdminMovementController {

    @DubboReference
    private MovementsService movementsService;

    /**
     * 管理端分页获取动态列表
     *
     * @return
     */
    @GetMapping("/all")
    public R<PageVO<AdminMovementsVO>> getAllMovement(AdminMovementsDTO dto) {
        return R.success(movementsService.getMovementPage(dto));
    }

    /**
     * 管理端-审核分页获取动态列表
     *
     * @return
     */
    @GetMapping("/audit")
    public R<String> get(AdminMovementsDTO dto) {
        movementsService.auditMovements(dto);
        return R.success("操作成功");
    }
}
